package com.eati.cm.serv.dispacher;

import javax.servlet.http.HttpServletRequest;

import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.web.bind.MissingServletRequestParameterException;

import com.eati.cm.auth.ThirdpartyAuthCBToken;
import com.eati.cm.utils.HttpUtil;

@Disp
public class GiteeLoginDisp implements LoginDisp{

    @Override
    public AbstractAuthenticationToken squeeze(HttpServletRequest req) throws MissingServletRequestParameterException {
    	return new ThirdpartyAuthCBToken(HttpUtil.checkGetParam(req, "code"), "gitee");
    }
    
    @Override
	public String getThirdpartyUsrId(String code) {
    	return "TESTUSRNAME";
    }
}
